﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MimiDouban.Abstract.Beans;

namespace MimiDouban.Abstract
{
    /// <summary>
    /// 歌曲提供器的抽象接口
    /// </summary>
    public interface ISongProvider
    {
        /// <summary>
        /// 当前是否已经登录
        /// </summary>
        /// <returns></returns>
        bool isLogin();//是否已经登录

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="username">用户名</param>
        /// <param name="password">密码</param>
        /// <returns>登录结果</returns>
        DoubanUser login(string username,string password);

        /// <summary>
        /// 一开始的时候获取一首歌和初始的频道
        /// </summary>
        /// <param name="firstSong">第一首播放的歌</param>
        /// <param name="firstChannelId">第一个频道号</param>
        void onInit(out DoubanSong firstSong, out int firstChannelId, out string username);

        /// <summary>
        /// 喜欢，返回成功状态
        /// </summary>
        /// <returns>成功状态</returns>
        bool onLike();

        /// <summary>
        /// 取消喜欢
        /// </summary>
        /// <returns>返回成功状态</returns>
        bool onLikeCancelled();

        /// <summary>
        /// 不喜欢
        /// </summary>
        /// <returns>返回下面该放的一首歌</returns>
        DoubanSong onDislike();
 
        /// <summary>
        /// 直接获取
        /// </summary>
        /// <returns>下一首歌</returns>
        DoubanSong onNext();

        /// <summary>
        /// 切换了频道，返回
        /// </summary>
        /// <param name="channelId">新频道号</param>
        /// <returns>切换频道后的下一首歌</returns>
        DoubanSong onChannelChanged(int channelId);//

        /// <summary>
        /// 歌放完了，返回
        /// </summary>
        /// <returns>下一首歌</returns>
        DoubanSong onFinished();


        /// <summary>
        /// 关闭程序时调用
        /// </summary>
        void end();
    }
}
